function submitonclick() { encryptCustomerPass(); var objForm=document.frmlogin; var vUser=objForm.txtUser.value; var vPass=objForm.txtPassword.value; var captchaval = ""; if(vUser=="") { alert("Please Enter the User Name"); objForm.txtPassword.value="";return } else { if(vPass=="") { alert("Please enter the password"); return } } if(document.getElementById("passlineval")) { captchaval = objForm.passlineval.value; if(document.getElementById("passlineval")) { if(document.getElementById("passlineval").value!="" && document.getElementById("passlineval").value!=null) { document.getElementById("passline").value = document.getElementById("passlineval").value; document.getElementById("passline_enc").value = document.getElementById("passline_enc_val").value; captchaval = objForm.passline.value; } } document.getElementById("passlineval").remove(); document.getElementById("passline_enc_val").remove(); } objForm.submit() } function cancelonclick(){window.close()}function setForgotPwdFlag(){var objForm=document.frmlogin;var vUser=objForm.txtUser.value;if(vUser==""){alert("Please enter the user name");objForm.txtPassword.value="";return}objForm.txtForgotPwd.value="1";objForm.submit()}function chkSpecialChar(txtid){var iChars="~`!@#$%^&*()+=-[]\\';,./{}|\":<>?";for(var i=0;i<(document.getElementById(txtid).value).length;i++){if(iChars.indexOf((document.getElementById(txtid).value).charAt(i))!=-1){alert("Special characters are not allowed");document.getElementById(txtid).value="";document.getElementById(txtid).focus();return false}}}; var JSON={stringify:function(arg){return this.toJsonStringArray(arg).join("")},toJsonStringArray:function(arg,out){out=out||new Array();var u;switch(typeof arg){case"object":if(arg){if(arg.constructor==Array){out.push("[");for(var i=0;i0){out.push(",")}this.toJsonStringArray(arg[i],out)}out.push("]");return out}else{if(typeof arg.toString!="undefined"){out.push("{");var first=true;for(var i in arg){var curr=out.length;if(!first){out.push(",")}this.toJsonStringArray(i,out);out.push(":");this.toJsonStringArray(arg[i],out);if(out[out.length-1]==u){out.splice(curr,out.length-curr)}else{first=false}}out.push("}");return out}}return out}out.push("null");return out;case"unknown":case"undefined":case"function":out.push(u);return out;case"string":out.push('"');out.push(arg.replace(/(["\\])/g,"\\$1").replace(/\r/g,"").replace(/\n/g,"\\n"));out.push('"');return out;default:out.push(String(arg));return out}}}; function encryptCustomerPass() { var objForm=document.frmlogin; var vPass=objForm.txtPassword.value; var cToken=objForm.client_token.value; //alert(cToken); var hashObj=""; hashObj= new jsSHA(vPass, "TEXT"); hashObj=hashObj.getHash("SHA-512", "HEX"); //alert(hashObj); hashObj=hashObj+cToken; hashObj= new jsSHA(hashObj, "TEXT"); hashObj=hashObj.getHash("SHA-512", "HEX"); //alert(hashObj); objForm.txtPassword.value=hashObj; document.getElementById("passwordforshow").value=hashObj; } function submitformforRefresh() { var xhr = new XMLHttpRequest(); xhr.open('POST', 'Captcha.jsp'); xhr.setRequestHeader('Content-Type', 'application/json'); xhr.onload = function() { if (xhr.status === 200) { document.getElementById("passline_enc_val").value=xhr.responseText.trim(); document.getElementById("includedContent").innerHTML = "\"Refresh\""; } }; xhr.send(); }